package org.easy.spring;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;

@Configuration
public class EnvConfig {
    @Value("${spring.profiles.active:dev}")
    private String active;

    public String getActive() {
        return active;
    }

    public void setActive(String active) {
        this.active = active;
    }

    public boolean isProd() {
        return this.active.startsWith("pro") || this.active.startsWith("pre");
    }

    public boolean isDev() {
        return this.active.startsWith("dev");
    }

    public boolean isTest() {
        return this.active.startsWith("test");
    }

    public String getMarkEnvPrefix() {
        return getActive() + "_";
    }


}
